<!--
 * @Author: wangze@linkstec.com
 * @Date: 2022-02-23 12:16:06
 * @Function: Please Input Function
-->
<script>
import { Empty } from 'element-ui';
import imgEmptyList from '@/assets/image/empty-list.png';

export default {
  name: 'LkEmpty',
  components: {},
  props: Object.assign({}, Empty.props, {
    description: {
      type: String,
      default: '暂无数据'
    },
    imageSize: {
      type: Number,
      default: 46
    },
    icon: {
      type: String,
      default: ''
    },
    full: {
      type: Boolean,
      default: false
    }
  }),
  // 定义属性
  data () {
   return {

   };
  },
  // 计算属性，会监听依赖属性值随之变化
  computed: {},
  // 监控data中的数据变化
  watch: {},
  // 方法集合
  methods: {

  },
  render () {
    const props = {};
    Object.keys(Empty.props).forEach(k => {
      typeof this[k] !== 'undefined' && (props[k] = this[k]);
      return props[k];
    });
    const attrs = {};
    Object.keys(this.$attrs).forEach(k => {
      typeof this[k] !== 'undefined' && (attrs[k] = this[k]);
    });
    if (this.icon === 'list') {
      props.image = imgEmptyList;
    }
    if (this.full) {
      attrs.style = 'height: 100%';
    }

    return (
      <el-empty class="lk-empty" {...{ props, attrs, on: this.$listeners, scopedSlots: { ...this.$scopedSlots } }}><slot></slot></el-empty>
    );
  }
};
</script>

<style lang='scss' scoped>
.lk-empty {
  line-height: 1.5;
}
</style>
